Extract a summary "specification" table from a requirements document

Dear Team,

Here is what I would like to do - extract a summary "specification" table from a requirements document.

For example, let's say a requirements module has 10 requirements in it, and the object text of each reads like this: "The rotor shall turn at a rate of 10 Hz."

Does there exist a macro or DXL script that will allow mw to "tag" the "10 Hz" and later populate a table (much like a view would be used) with all of the items I "tagged" in those 10 requirement's object text?

Thanks!
SystemAdmin - Mon Jun 21 09:14:12 EDT 2010

Re: Extract a summary "specification" table from a requirements document
llandale - Mon Jun 21 11:13:57 EDT 2010

Not following completely. Wonder why a single document would have 10 identical requirements.

Perhaps you want some sort of string 'Requirement-Quantity' attribute intended to house just the quantity referenced in the requirement text. Then view or export that as need be.

It would be difficult to write a DXL that would accurately find the quantity in a sentance and move it to the new attribute, but you could write one that thinks it finds it and offers to make the copy.

  • Louie

Re: Extract a summary "specification" table from a requirements document
Z_T - Mon Jun 21 11:38:14 EDT 2010

How about creating a view with regular express filter?

Re: Extract a summary "specification" table from a requirements document
SystemAdmin - Thu Jun 24 14:42:45 EDT 2010

llandale - Mon Jun 21 11:13:57 EDT 2010
Not following completely. Wonder why a single document would have 10 identical requirements.

Perhaps you want some sort of string 'Requirement-Quantity' attribute intended to house just the quantity referenced in the requirement text. Then view or export that as need be.

It would be difficult to write a DXL that would accurately find the quantity in a sentance and move it to the new attribute, but you could write one that thinks it finds it and offers to make the copy.

  • Louie

Dear Louie,

Thanks for considering my question!

Let me try to be more clear. The document does not contain 10 "identical" requirements. Rather, I want to use the requirements document to populate a table without all the requirement text - just the "tagged' parameters - however many there are. I think you have it right where you say "some sort of string 'Requirement-Quantity' attribute." I guess I am looking for a DXL that would accurately find the quantity (tagged in advance as one of the quantities I want exported whan i perform the operation)in a sentence and copy it to the new attribute or view or even just an exportable docuent that serves as a static update.

Perhaps this has already been done - Do you know anyone who may have accomplished this already?

Thanks!

RRG

Re: Extract a summary "specification" table from a requirements document
SystemAdmin - Thu Jun 24 14:45:24 EDT 2010

Z_T - Mon Jun 21 11:38:14 EDT 2010
How about creating a view with regular express filter?

Dear Z T,

Thanks for considering my question. What is an express" filter?

Thanks!

RRG

Re: Extract a summary "specification" table from a requirements document
Z_T - Fri Jun 25 18:56:42 EDT 2010

SystemAdmin - Thu Jun 24 14:45:24 EDT 2010
Dear Z T,

Thanks for considering my question. What is an express" filter?

Thanks!

RRG

BlackDragon - It's Regular Express and it's used when you want to detect a pattern or patterns.

Try this:
- With Standar View, select Tools->Filer->Define...
- With the Attribute tab, select "Object Text" for attribute, contains for Condition, and value "sShall .* 10 Hz" (without the surrounding quotes.
- Uncheck Match Case and check Regular Express option

The value "sShall .* 10 Hz" means look for the word "shall " or "Shall " then zero or more characters (any character excep newline) and "10 Hz". I assume you use shall or Shall in your requirement text.

Re: Extract a summary "specification" table from a requirements document
Z_T - Fri Jun 25 18:58:34 EDT 2010

Z_T - Fri Jun 25 18:56:42 EDT 2010
BlackDragon - It's Regular Express and it's used when you want to detect a pattern or patterns.

Try this:
- With Standar View, select Tools->Filer->Define...
- With the Attribute tab, select "Object Text" for attribute, contains for Condition, and value "sShall .* 10 Hz" (without the surrounding quotes.
- Uncheck Match Case and check Regular Express option

The value "sShall .* 10 Hz" means look for the word "shall " or "Shall " then zero or more characters (any character excep newline) and "10 Hz". I assume you use shall or Shall in your requirement text.

it should read "[sS]hall .* 10 Hz"

Re: Extract a summary "specification" table from a requirements document
llandale - Sun Jun 27 21:26:10 EDT 2010

SystemAdmin - Thu Jun 24 14:42:45 EDT 2010
Dear Louie,

Thanks for considering my question!

Let me try to be more clear. The document does not contain 10 "identical" requirements. Rather, I want to use the requirements document to populate a table without all the requirement text - just the "tagged' parameters - however many there are. I think you have it right where you say "some sort of string 'Requirement-Quantity' attribute." I guess I am looking for a DXL that would accurately find the quantity (tagged in advance as one of the quantities I want exported whan i perform the operation)in a sentence and copy it to the new attribute or view or even just an exportable docuent that serves as a static update.

Perhaps this has already been done - Do you know anyone who may have accomplished this already?

Thanks!

RRG

So. The Object Text contains Requirements and many have tagged expressions therein. You want to extract the tagged expression for display and or export.

Use AttrDXL to extract the expression, what the heck into an attribute named 'TaggedExpression', and display that in views when you intend to export, or just query the value from some other DXL.

I don't think I can parse your example: "The rotor shall turn at a rate of 10 Hz.", unless you know the tagged expression is a validInteger-space-Hz. But I presume you also want to extract other quanties, such as weight, rpm, etc. But WAIT! Perhaps your 'tagged expression' is really just validIntegerOrReal-space-anyWord. So we look for "2.4 lbs" or "2800 rp; that should work so long as the 'units' (the 'word') always follows the quantity.

Regexp re = regexp("([0-9\\.]+ [a-zA-Z0-9]+)")
 
string    GetExpression(string Text)
{     // get numeric expression from the text, if any
 
        string  Expression
        if (re Text)
        {  Expression = Text[match 1]
           if (Expression[0:1] == ". ") //
           then return("")             // skip just periods
           else return(Expression)
        }
        else return("")
}     // end GetExpression
 
 
void    DoTest(string Text)
{
        print (GetExpression(Text)) "\t[" Text "]\n"
}
 
DoTest("The System shall perform 11 rpm at all times")
DoTest("The System shall perform 1.1 rpm at all times\bnaniother line 13 rpm dddd")
DoTest("The System shall perform 11 rpm at all times\bnaniother line 13 rpm dddd")


It only finds the first expression, as shown in the 2nd text.

Since there are lots of folks who read this who want to one-up on me, hopefully someone will expand the regular expression with defense I don't understand.

Now, if you are actually planning to TAG the expressions, perhaps "The rotor shall turn at a rate of [10 Hz].", then it should be easy to look for the bracket pairs and extract what's in the middle.

 

 

  • Louie